function [ax,ph]=PlotScalarIRF(irf,Title,LineStyle,ax,XAxis)

% Shock       =   'eps_Z';
% Response    =   'Y';

% irf         =   IRF.(Shock).(Response);
max_pos     =   max(max(irf,0));
max_neg     =   -min(min(irf,0));
max_abs     =   max(max_pos,max_neg);
if max_abs==0
    max_abs     =   0.01;
end
if nargin<3 || isempty(LineStyle)
    LineStyle   =   'k-';
end
if nargin<5
    XAxis   =   (0:1:length(irf)-1)';
end
ph          =   plot(XAxis,irf,LineStyle,'linewidth',3);

if nargin<5
    hold on;
    refline(0,0);
else
    hold on;
    plot(XAxis,zeros(size(irf)),'color',[0.6,0.6,0.6]);
end

if ~isempty(Title)
    h   =   title(Title);
    set(h,'Interpreter','latex','fontsize',16);
end

if nargin<4 || isempty(ax)
    ax          =   gca;
end
exponent    =   floor(log(max_abs)/log(10));
ax.YLim     =   [-max_abs*1.05,max_abs*1.05];
ax.YTick    =   linspace(-max_abs*1.05,max_abs*1.05,7)';
if nargin<5
    ax.XTick    =   (0:4:length(irf)-1)';
else
    ax.XTick    =   linspace(XAxis(1),XAxis(end),6)';
    datetick('x','yy','keepticks','keeplimits');
end
ax.YAxis.Exponent       =   exponent;
ax.YAxis.TickLabelFormat=     '%.1g';
ax.YAxis.FontSize   =   14;
ax.XAxis.FontSize   =   14;
ax.XGrid    =   'on';
ax.YGrid    =   'on';